# f=open('D:/sms/python01/testread.txt','r',encoding='utf-8')
# text=f.readlines()
# text=f.readlines
# print(text)
# f.close
#打开一个文件并读取文件内容
# with open('D:/sms/python01/testwrite.txt','r',encoding='utf-8') as f:
#     test=f.readlines()
#     print(test)
  
#写入内容到一个文件
with open('D:/sms/python01/testwrite.txt','a',encoding='utf-8') as f:
    text='测试写入文件内容'
    f.write(text)
    f.seek(1)
    f.write('south')
# w ，文件不存在则创建一个，存在则覆盖
# a ,在文件尾部写入
    